Fix problem with menu titles being clipped (#75948)
authorSoeren Sandmann <sandmann@daimi.au.dk>
Thu, 4 Apr 2002 20:28:47 +0000 (20:28 +0000)
committerSøren Sandmann Pedersen <ssp@src.gnome.org>
Thu, 4 Apr 2002 20:28:47 +0000 (20:28 +0000)
Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

* gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
titles being clipped (#75948)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmenuitem.c
tests/testgtk.c

index e3372ad63146089a9b0b3900cdc6714d2038b0be..c4514adba6f6b05d647e20e5272172d26512b265 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+       titles being clipped (#75948)
+       
 2002-04-04  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
index e3372ad63146089a9b0b3900cdc6714d2038b0be..c4514adba6f6b05d647e20e5272172d26512b265 100644 (file)
@@ -1,3 +1,8 @@
+Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+       titles being clipped (#75948)
+       
 2002-04-04  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
index e3372ad63146089a9b0b3900cdc6714d2038b0be..c4514adba6f6b05d647e20e5272172d26512b265 100644 (file)
@@ -1,3 +1,8 @@
+Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+       titles being clipped (#75948)
+       
 2002-04-04  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
index e3372ad63146089a9b0b3900cdc6714d2038b0be..c4514adba6f6b05d647e20e5272172d26512b265 100644 (file)
@@ -1,3 +1,8 @@
+Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+       titles being clipped (#75948)
+       
 2002-04-04  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
index e3372ad63146089a9b0b3900cdc6714d2038b0be..c4514adba6f6b05d647e20e5272172d26512b265 100644 (file)
@@ -1,3 +1,8 @@
+Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+       titles being clipped (#75948)
+       
 2002-04-04  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
index e3372ad63146089a9b0b3900cdc6714d2038b0be..c4514adba6f6b05d647e20e5272172d26512b265 100644 (file)
@@ -1,3 +1,8 @@
+Thu Apr  4 22:28:08 2002  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+       titles being clipped (#75948)
+       
 2002-04-04  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
index 2735a5c141f61105c52a70ab47e622593701e9e8..5e30156e9f24f4c2092044ee2d1f41772ef6ad73 100644 (file)
@@ -614,9 +614,16 @@ gtk_menu_item_paint (GtkWidget    *widget,
 
       if (menu_item->submenu && menu_item->show_submenu_indicator)
        {
+         GtkRequisition child_requisition;
          gint arrow_x, arrow_y;
-         gint arrow_size = height - 2 * widget->style->ythickness;
-         gint arrow_extent = arrow_size / 2;
+         gint arrow_size;
+         gint arrow_extent;
+
+         gtk_widget_get_child_requisition (GTK_BIN (menu_item)->child,
+                                           &child_requisition);
+
+         arrow_size = child_requisition.height - 2 * widget->style->ythickness;
+         arrow_extent = arrow_size * 0.6;
          
          shadow_type = GTK_SHADOW_OUT;
          if (state_type == GTK_STATE_PRELIGHT)
index 997ba0c63347c310290108964b06edaf1cdf3f4b..f744220c61b372568353b3cb5badd00700313ffa 100644 (file)
@@ -2487,19 +2487,19 @@ void create_labels (void)
       frame = gtk_frame_new ("Internationalized Label");
       label = gtk_label_new (NULL);
       gtk_label_set_markup (GTK_LABEL (label),
-                           "French (Français) Bonjour, Salut\n"
-                           "Korean (í\95\9cê¸\80)   ì\95\88ë\85\95í\95\98ì\84¸ì\9a\94, ì\95\88ë\85\95í\95\98ì\8b­ë\8b\88ê¹\8c\n"
-                           "Russian (РÑ\83Ñ\81Ñ\81кий) Ð\97дÑ\80авÑ\81Ñ\82вÑ\83йÑ\82е!\n"
-                           "Chinese (Simplified) <span lang=\"zh-cn\">元气   开发</span>\n"
-                           "Chinese (Traditional) <span lang=\"zh-tw\">å\85\83æ°£  é\96\8bç\99¼</span>\n"
-                           "Japanese <span lang=\"ja\">å\85\83æ°\97  é\96\8bç\99º</span>");
+                           "French (Fran\81Ã\81§ais) Bonjour, Salut\n"
+                           "Korean (\81í\95\9c\81ê\81¸\80)   \81ì\95\88\81ë\85\95\81í\95\98\81ì\84\81¸\81ì\9a\94\81ì\95\88\81ë\85\95\81í\95\98\81ì\8b\81­\81ë\8b\88\81ê\81¹\8c\n"
+                           "Russian (\81Ð\81 \81Ñ\83\81Ñ\81\81Ñ\81\81Ð\81º\81Ð\81¸\81Ð\81¹) \81Ð\97\81Ð\81´\81Ñ\80\81Ð\81°\81Ð\81²\81Ñ\81\81Ñ\82\81Ð\81²\81Ñ\83\81Ð\81¹\81Ñ\82\81Ð\81µ!\n"
+                           "Chinese (Simplified) <span lang=\"zh-cn\">\81å\85\83\81æ\81°\94        \81å\81¼\80\81发</span>\n"
+                           "Chinese (Traditional) <span lang=\"zh-tw\">\81å\85\83\81æ\81°\81£      \81é\96\8b\81ç\99\81¼</span>\n"
+                           "Japanese <span lang=\"ja\">\81å\85\83\81æ\81°\97       \81é\96\8b\81ç\99\81º</span>");
       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
       gtk_container_add (GTK_CONTAINER (frame), label);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
       frame = gtk_frame_new ("Bidirection Label");
-      label = gtk_label_new ("Arabic   السلام عليكم\n"
-                            "Hebrew    שלום");
+      label = gtk_label_new ("Arabic   \81Ø\81§\81Ù\84\81Ø\81³\81Ù\84\81Ø\81§\81Ù\85 \81Ø\81¹\81Ù\84\81Ù\8a\81Ù\83\81م\n"
+                            "Hebrew    \81×\81©\81×\9c\81×\95\81ם");
       gtk_widget_set_direction (label, GTK_TEXT_DIR_RTL);
       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
       gtk_container_add (GTK_CONTAINER (frame), label);
@@ -2535,7 +2535,7 @@ void create_labels (void)
 
       frame = gtk_frame_new ("Underlined label");
       label = gtk_label_new ("This label is underlined!\n"
-                            "This one is underlined (ã\81\93ã\82\93ã\81«ã\81¡ã\81¯) in quite a funky fashion");
+                            "This one is underlined (\81ã\81\93\81ã\82\93\81ã\81\81«\81ã\81\81¡\81ã\81\81¯) in quite a funky fashion");
       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
       gtk_label_set_pattern (GTK_LABEL (label), "_________________________ _ _________ _ _____ _ __ __  ___ ____ _____");
       gtk_container_add (GTK_CONTAINER (frame), label);
@@ -3489,7 +3489,7 @@ static GtkItemFactoryEntry menu_items[] =
   { "/File/_Save",             NULL,         gtk_ifactory_cb,       0, "<StockItem>", GTK_STOCK_SAVE },
   { "/File/Save _As...",       "<control>A", gtk_ifactory_cb,       0, "<StockItem>", GTK_STOCK_SAVE },
   { "/File/_Dump \"_Accels\"",  NULL,        dump_accels,           0 },
-  { "/File/\\/Test__Escaping/And\\/\n\tWei\\\\rdly",
+  { "/File/\\/Test__Escaping/And\\/\n\tWei\\\\rdly/and more",
                                 NULL,        gtk_ifactory_cb,       0 },
   { "/File/sep1",        NULL,               gtk_ifactory_cb,       0, "<Separator>" },
   { "/File/_Quit",       NULL,               gtk_ifactory_cb,       0, "<StockItem>", GTK_STOCK_QUIT },
@@ -3648,9 +3648,9 @@ create_key_lookup (void)
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
       button = gtk_button_new_with_mnemonic ("Button 2 (_A)");
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
-      button = gtk_button_new_with_mnemonic ("Button 3 (_ф)");
+      button = gtk_button_new_with_mnemonic ("Button 3 (_\81ф)");
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
-      button = gtk_button_new_with_mnemonic ("Button 4 (_Ф)");
+      button = gtk_button_new_with_mnemonic ("Button 4 (_\81Ð\81¤)");
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
       button = gtk_button_new_with_mnemonic ("Button 6 (_b)");
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
@@ -4073,7 +4073,7 @@ create_entry (void)
       gtk_box_pack_start (GTK_BOX (box2), hbox, TRUE, TRUE, 0);
       
       entry = gtk_entry_new ();
-      gtk_entry_set_text (GTK_ENTRY (entry), "hello world السلام عليكم");
+      gtk_entry_set_text (GTK_ENTRY (entry), "hello world \81Ø\81§\81Ù\84\81Ø\81³\81Ù\84\81Ø\81§\81Ù\85 \81Ø\81¹\81Ù\84\81Ù\8a\81Ù\83\81م");
       gtk_editable_select_region (GTK_EDITABLE (entry), 0, 5);
       gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);